<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;

?>


    <div id="container">

        <div class="clearfix">
            <div class="content_l">
                <div class="fl" id="resume_name">

                    <div class="nameShow fl">
                        <h1><?=$_SESSION['user']['user_name']?>的简历</h1> | <a target="_blank" href="?r=resume/show_resume">预览</a>
                    </div>
                </div>



                <div class="fr c5" id="lastChangedTime">
                    <span>
                        <?php if($resume->time){  ?>
                            最后一次更新：2014-07-01 15:14
                        <?php }?>
                    </span>
                </div>


                <div id="resumeScore">
                    <div class="score fl">
                        <canvas height="120" width="120" id="doughnutChartCanvas" style="width: 120px; height: 120px;"></canvas>
                        <div style="" class="scoreVal"><span>15</span>分</div>
                    </div>

                    <div class="which fl">
                        <div>工作经历最能体现自己的工作能力，且完善后才可投递简历哦！</div>
                        <span rel="workExperience"><a>马上去完善</a></span>
                    </div>
                </div><!--end #resumeScore-->



                <div class="profile_box" id="basicInfo">
                    <h2>基本信息</h2>
                    <span class="c_edit"></span>

                    <div class="basicShow">


                        <?php if( $resume->resume_name    ){ ?>

                        <span>
                            <?= $resume->resume_name    ?> |
                                <?php if($resume->resume_sex){echo '男';}else{echo '女';}?> |

                                <?= $resume->resume_degree ? $resume->resume_degree.'|' :''; ?>

                                <?php if($resume->resume_experience){   ?>
                                        <?= $resume->resume_experience ?>工作经验<br>
                                <?php } ?>


                                <?= $resume->resume_tel ? $resume->resume_tel.'|' :''  ?>
                                <?= $resume->resume_email ? $resume->resume_email.'|':'' ?><br>
            			</span>

                        <?php }else{?>
                                <span>还没有呀信息,快去添加... </span>
                        <?php }?>


                        <div class="m_portrait">
                            <div></div>
<!--                            <img width="120" height="120" alt="jason" src="style/images/default_headpic.png">-->
                            <img width="120" height="120" alt="jason" src="<?=$resume->resume_img?>">
                        </div>
                    </div><!--end .basicShow-->


                    <div class="basicEdit dn">


<!--                        <form action="?r=resume/index" method="post" enctype="multipart/form-data">-->
                            <?php $form = ActiveForm::begin([ 'options'=>['enctype'=>'multipart/form-data']  ]); ?>

                            <table>
                                <tbody><tr>
                                    <td valign="top">
                                        <span class="redstar">*</span>
                                    </td>
                                    <td>
                                        姓名:
                <input type="text" placeholder="姓名" value="<?=$resume->resume_name?>" name="resume_name">
                                    </td>
                                    <td valign="top"></td>
                                    <td>
                                        <ul class="resume_sex profile_radio clearfix reset">
                                            <li class="current" value="1">
                                                男<em></em>
                                                <input type="radio" checked="checked" name="gender" value="1">
                                            </li>
                                            <li value="0">
                                                女<em></em>
                                                <input type="radio" name="gender" value="0">
                                            </li>
                                        </ul>
                                    </td>
                                </tr>


                                <tr>
                                    <td valign="top">
                                        <span class="redstar">*</span>
                                    </td>


                                    <td>

                                        <input type="button" value="" id="select_topDegree" class="profile_select_190 profile_select_normal">
                                        <div class="boxUpDown boxUpDown_190 dn" id="box_topDegree" style="display: none;">
                                            <ul>
                                                <li>大专</li>
                                                <li>本科</li>
                                                <li>硕士</li>
                                                <li>博士</li>
                                                <li>其他</li>
                                            </ul>
                                        </div>
                                    </td>


                                    <td valign="top">
                                        <span class="redstar">*</span>
                                    </td>
                                    <td>
                                        <input type="button" value="" id="select_workyear" class="profile_select_190 profile_select_normal">
                                        <div class="boxUpDown boxUpDown_190 dn" id="box_workyear" style="display: none;">
                                            <ul>
                                                <li>1年</li>
                                                <li>2年</li>
                                                <li>3年</li>
                                                <li>4年</li>
                                                <li>5年</li>
                                                <li>6年</li>
                                                <li>7年</li>
                                                <li>8年</li>
                                                <li>9年</li>
                                                <li>10年</li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>


                                <tr>
                                    <td valign="top">
                                        <span class="redstar">*</span>
                                    </td>
                                    <td colspan="3">
                                手机号码:
                                        <input type="text" placeholder="手机号码" value="<?=$resume->resume_tel?>" name="tel">
                                    </td>
                                </tr>

                                <tr>
                                    <td valign="top">
                                        <span class="redstar">*</span>
                                    </td>
                                    <td colspan="3">
                                        邮箱:
                                        <input type="text" placeholder="接收面试通知的邮箱" value="<?=$resume->resume_email?>" name="email" >
                                    </td>
                                </tr>


                                <tr>
                                    <td valign="top">
                                        <span class="redstar">*</span>
                                    </td>
                                    <td colspan="3">

<!--                                        <input  type="file" name="resume_img" >-->
<!--                                        <input class="btn_profile_save" type="submit" value="上传或更改头像">-->
                                        <?= $form->field($model, 'resume_img')->fileInput()->label('上传或更改头像') ?>
                                        <button>上传或更改头像</button>

                                    </td>
                                </tr>



                                <tr>
                                    <td></td>
                                    <td colspan="3">
                                        <input id="button_1" type="button" value="保 存" class="btn_profile_save">
                                        <a class="btn_profile_cancel" href="javascript:;">取 消</a>
                                    </td>
                                </tr>

                                </tbody>
                            </table>
<!--                        </form><!--end #profileForm-->
                        <?php ActiveForm::end(); ?>




                        <form method="post">
                        <div class="new_portrait">
                            <div class="portrait_upload" id="portraitNo">
                                <span>上传自己的头像</span>
                            </div>
                            <div class="portraitShow dn" id="portraitShow">
                                <img width="120" height="120" src="">
                                <span> </span>
                            </div>
<!--                     <input type="file" value="" title="支持jpg、jpeg、gif、png格式，文件小于5M" onchange="img_check(this,'h/resume/uploadPhoto.json','headPic');" name="headPic" id="headPic" class="myfiles">-->
<!--                        <input type="file" title="支持jpg、jpeg、gif、png格式，文件小于5M"  name="headPic" id="headPic" class="myfiles">-->

                            <!-- <input type="hidden" id="headPicHidden" /> -->
                            <em>
                                尺寸：120*120px <br>
                                大小：小于5M
                            </em>
                            <span style="display:none;" id="headPic_error" class="error"></span>
                        </div><!--end .new_portrait-->

                        </form>


                    </div><!--end .basicEdit-->


                    <input type="hidden" id="nameVal" value="<?=$resume->resume_tel?>">
                    <input type="hidden" id="genderVal" value="<?=$resume->resume_sex?>">
                    <input type="hidden" id="topDegreeVal" value="<?=$resume->resume_degree?>">
                    <input type="hidden" id="workyearVal" value="<?=$resume->resume_experience?>">
                    <input type="hidden" id="emailVal" value="<?=$resume->resume_email?>">
                    <input type="hidden" id="telVal" value="<?=$resume->resume_tel?>">


                </div><!--end #basicInfo-->

                <script>
                    $(function(){

                        $("#button_1").click(function(){
                            var resume_name = $("input[name=resume_name]").val(); // 姓名
                            var resume_sex = $(".resume_sex .current").attr('value');     //性别
                            var resume_degree = $("#select_topDegree").val(); //学历
                            var resume_experience = $("#select_workyear").val();//工作经验
                            var resume_tel = $("input[name=tel]").val();//电话
                            var resume_email = $("input[name=email]").val();


                            $.ajax({
                                url:"?r=resume/jbxi",
                                type:"post",
                                data:{
                                    'resume_name':resume_name,
                                    'resume_sex':resume_sex,
                                    'resume_degree':resume_degree,
                                    'resume_experience':resume_experience,
                                    'resume_tel':resume_tel,
                                    'resume_email':resume_email
                                },
                                dataType:'json',
                                success:function(data){
                                    alert(data.msg)
                                    if(data.status){
                                        location.href="?r=resume/index";
                                    }
                                }
                            })

                        })

                    })
                </script>




                <div class="profile_box" id="workExperience" >
                    <h2>工作经历  <span> （投递简历时必填）</span></h2>
                    <span class="c_add dn"></span>

                    <ul>

                        <?php if($resume->company_name){?>
                        <li>公司名称:<?= Html::encode( $resume->company_name )?> | 职位名称:<?=$resume->position_name?> | 工作时间:<?=$resume->begin_year?>-<?=$resume->begin_month?> ~ <?=$resume->end_year?>-<?=$resume->end_month?></li>
                        <?php }else{?>
                        <li>还没有工作经历, 快去填写</li>
                        <?php }?>
                    </ul>



                    <div class="experienceEdit dn" >
                        <form class="experienceForm">
                            <table>
                                <tbody><tr>
                                    <td valign="top">
                                        <span class="redstar">*</span>
                                    </td>
                                    <td>
                                        <input type="text" placeholder="公司名称，如：百度" name="companyName" class="companyName">
                                    </td>
                                    <td valign="top">
                                        <span class="redstar">*</span>
                                    </td>
                                    <td>
                                        <input type="text" placeholder="职位名称，如：产品经理" name="positionName" class="positionName">
                                    </td>
                                </tr>

                                <tr>
                                    <td valign="top">
                                        <span class="redstar">*</span>
                                    </td>
                                    <td>
                                        <div class="fl">
                                            <input type="hidden" class="companyYearStart" value="" name="companyYearStart">
                                            <input type="button" value="开始年份" class="profile_select_139 profile_select_normal select_companyYearStart">
                                            <div class="box_companyYearStart boxUpDown boxUpDown_139 dn" style="display: none;">
                                                <ul>
                                                    <li>2014</li>
                                                    <li>2013</li>
                                                    <li>2012</li>
                                                    <li>2011</li>
                                                    <li>2010</li>
                                                    <li>2009</li>
                                                    <li>2008</li>
                                                    <li>2007</li>
                                                    <li>2006</li>
                                                    <li>2005</li>
                                                    <li>2004</li>
                                                    <li>2003</li>
                                                    <li>2002</li>
                                                    <li>2001</li>
                                                    <li>2000</li>
                                                    <li>1999</li>
                                                    <li>1998</li>
                                                    <li>1997</li>
                                                    <li>1996</li>
                                                    <li>1995</li>
                                                    <li>1994</li>
                                                    <li>1993</li>
                                                    <li>1992</li>
                                                    <li>1991</li>
                                                    <li>1990</li>
                                                    <li>1989</li>
                                                    <li>1988</li>
                                                    <li>1987</li>
                                                    <li>1986</li>
                                                    <li>1985</li>
                                                    <li>1984</li>
                                                    <li>1983</li>
                                                    <li>1982</li>
                                                    <li>1981</li>
                                                    <li>1980</li>
                                                    <li>1979</li>
                                                    <li>1978</li>
                                                    <li>1977</li>
                                                    <li>1976</li>
                                                    <li>1975</li>
                                                    <li>1974</li>
                                                    <li>1973</li>
                                                    <li>1972</li>
                                                    <li>1971</li>
                                                    <li>1970</li>
                                                </ul>
                                            </div>
                                        </div>
                                        <div class="fl">
                                            <input type="hidden" class="companyMonthStart" value="" name="companyMonthStart">
                                            <input type="button" value="开始月份" class="profile_select_139 profile_select_normal select_companyMonthStart">
                                            <div style="display: none;" class="box_companyMonthStart boxUpDown boxUpDown_139 dn">
                                                <ul>
                                                    <li>01</li><li>02</li><li>03</li><li>04</li><li>05</li><li>06</li><li>07</li><li>08</li><li>09</li><li>10</li><li>11</li><li>12</li>
                                                </ul>
                                            </div>
                                        </div>
                                        <div class="clear"></div>
                                    </td>
                                    <td valign="top">
                                        <span class="redstar">*</span>
                                    </td>
                                    <td>
                                        <div class="fl">
                                            <input type="hidden" class="companyYearEnd" value="" name="companyYearEnd">
                                            <input type="button" value="结束年份" class="profile_select_139 profile_select_normal select_companyYearEnd">
                                            <div class="box_companyYearEnd  boxUpDown boxUpDown_139 dn" style="display: none;">
                                                <ul>
<!--                                                    <li>至今</li>-->
                                                    <li>2014</li>
                                                    <li>2013</li>
                                                    <li>2012</li>
                                                    <li>2011</li>
                                                    <li>2010</li>
                                                    <li>2009</li>
                                                    <li>2008</li>
                                                    <li>2007</li>
                                                    <li>2006</li>
                                                    <li>2005</li>
                                                    <li>2004</li>
                                                    <li>2003</li>
                                                    <li>2002</li>
                                                    <li>2001</li>
                                                    <li>2000</li>
                                                    <li>1999</li>
                                                    <li>1998</li>
                                                    <li>1997</li>
                                                    <li>1996</li>
                                                    <li>1995</li>
                                                    <li>1994</li>
                                                    <li>1993</li>
                                                    <li>1992</li>
                                                    <li>1991</li>
                                                    <li>1990</li>
                                                    <li>1989</li>
                                                    <li>1988</li>
                                                    <li>1987</li>
                                                    <li>1986</li>
                                                    <li>1985</li>
                                                    <li>1984</li>
                                                    <li>1983</li>
                                                    <li>1982</li>
                                                    <li>1981</li>
                                                    <li>1980</li>
                                                    <li>1979</li>
                                                    <li>1978</li>
                                                    <li>1977</li>
                                                    <li>1976</li>
                                                    <li>1975</li>
                                                    <li>1974</li>
                                                    <li>1973</li>
                                                    <li>1972</li>
                                                    <li>1971</li>
                                                    <li>1970</li>
                                                </ul>
                                            </div>
                                        </div>
                                        <div class="fl">
                                            <input type="hidden" class="companyMonthEnd" value="" name="companyMonthEnd">
                                            <input type="button" value="结束月份" class="profile_select_139 profile_select_normal select_companyMonthEnd">
                                            <div style="display: none;" class="box_companyMonthEnd boxUpDown boxUpDown_139 dn">
                                                <ul>
                                                    <li>01</li><li>02</li><li>03</li><li>04</li><li>05</li><li>06</li><li>07</li><li>08</li><li>09</li><li>10</li><li>11</li><li>12</li>
                                                </ul>
                                            </div>
                                        </div>
                                        <div class="clear"></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td colspan="3">
                                        <input id="button_2" type="button" value="保 存" class="btn_profile_save">
                                        <a class="btn_profile_cancel" href="javascript:;">取 消</a>
                                    </td>
                                </tr>
                                </tbody></table>
                            <input type="hidden" class="expId" value="">
                        </form><!--end .experienceForm-->

                    </div><!--end .experienceEdit-->



                    <?php if( $resume->company_name && $resume->position_name && $resume->begin_year && $resume->begin_month && $resume->end_year && $resume->end_month){?>

                        <div class="experienceEdit dn">
                    <?php }else{?>
                            <div class="experienceAdd pAdd ">
                    <?php } ?>

                        工作经历最能体现自己的工作能力，<br>
                        且完善后才可投递简历哦！
                        <span>添加工作经历</span>
                    </div><!--end .experienceAdd-->
                </div><!--end #workExperience-->





                <script>
                    $(function(){
                        //工作经历
                        $(document).on('click',"#button_2",function(){

                            var company_name = $(".companyName").val(); // 公司名称
                            var position_name = $(".positionName").val(); // 职位名称

                            var begin_year = $("input[name=companyYearStart]").val(); // 开始年份
                            var begin_month = $("input[name=companyMonthStart]").val(); // 开始月份
                            var end_year = $("input[name=companyYearEnd]").val(); // 结束年份
                            var end_month = $("input[name=companyMonthEnd]").val(); // 结束月份

                            //工作经历
                            $.ajax({
                                url:"?r=resume/gzjl",
                                type:"post",
                                data:{
                                    'company_name':company_name,
                                    'position_name':position_name,
                                    'begin_year':begin_year,
                                    'begin_month':begin_month,
                                    'end_year':end_year,
                                    'end_month':end_month
                                },
                                dataType:'json',
                                success:function(data){
                                    alert(data.msg)
                                    if(data.status){
                                        location.href="?r=resume/index";
                                    }
                                }
                            })

                        })

                    })
                </script>






                <div class="profile_box" id="selfDescription">
                    <h2>自我描述</h2>

                    <?php if( $resume->my_content ){?>
                        <span class="c_edit"></span>
                    <?php }else{?>
                        <span class="c_edit dn"></span>
                    <?php }?>
                    <ul>
                        <li><?= Html::encode( $resume->my_content )?></li>
                    </ul>


                    <div class="descriptionShow dn">

                    </div><!--end .descriptionShow-->

                    <div class="descriptionEdit dn">
                        <form class="descriptionForm">
                            <table>
                                <tbody>
                                <tr>
                                    <td colspan="2">
                                        <textarea class="selfDescription s_textarea" name="selfDescription" placeholder=""></textarea>
                                        <div class="word_count">你还可以输入 <span>500</span> 字</div>
                                    </td>

                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <input id="button_3" type="button" value="保 存" class="btn_profile_save">
                                        <a class="btn_profile_cancel" href="javascript:;">取 消</a>
                                    </td>
                                </tr>
                                </tbody></table>
                        </form><!--end .descriptionForm-->
                    </div><!--end .descriptionEdit-->


                    <?php if( $resume->my_content ){?>



                     <?php }else{?>
                        <div class="descriptionAdd pAdd">
                            描述你的性格、爱好以及吸引人的经历等，<br>
                            让企业了解多元化的你！
                            <span>添加自我描述</span>
                        </div>

                    <?php } ?>




                    <!--end .descriptionAdd-->

                    <!--end #selfDescription-->


                    <script>
                        $(function(){
                            // 自我描述
                            $(document).on('click',"#button_3",function(){

                                var my_content = $("textarea[name=selfDescription]").val(); // // 自我描述

                                /// 自我描述
                                $.ajax({
                                    url:"?r=resume/my_content",
                                    type:"post",
                                    data:{'my_content':my_content},
                                    dataType:'json',
                                    success:function(data){
                                        alert(data.msg)
                                        if(data.status){
                                            location.href="?r=resume/index";
                                        }
                                    }
                                })

                            })

                        })
                    </script>

                <input type="hidden" id="resumeId" value="268472">

            </div><!--end .content_l-->


            <!--end .content_r-->


        </div>

        <input type="hidden" id="userid" name="userid" value="314873">

        <!-------------------------------------弹窗lightbox ----------------------------------------->
        <div style="display:none;">
            <!-- 上传简历 -->
            <div class="popup" id="uploadFile">
                <table width="100%">
                    <tbody><tr>
                        <td align="center">
                            <form>
                                <a class="btn_addPic" href="javascript:void(0);">
                                    <span>选择上传文件</span>
                                    <input type="file" onchange="file_check(this,'h/nearBy/updateMyResume.json','resumeUpload')" class="filePrew" id="resumeUpload" name="newResume" size="3" title="支持word、pdf、ppt、txt、wps格式文件，大小不超过10M" tabindex="3">
                                </a>
                            </form>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">支持word、pdf、ppt、txt、wps格式文件<br>文件大小需小于10M</td>
                    </tr>
                    <tr>
                        <td align="left" style="color:#dd4a38; padding-top:10px;">注：若从其它网站下载的word简历，请将文件另存为.docx格式后上传</td>
                    </tr>
                    <tr>
                        <td align="center"><img width="55" height="16" alt="loading" style="visibility: hidden;" id="loadingImg" src="style/images/loading.gif"></td>
                    </tr>
                    </tbody></table>
            </div><!--/#uploadFile-->

            <!-- 简历上传成功 -->
            <div class="popup" id="uploadFileSuccess">
                <h4>简历上传成功！</h4>
                <table width="100%">
                    <tbody><tr>
                        <td align="center"><p>你可以将简历投给你中意的公司了。</p></td>
                    </tr>
                    <tr>
                        <td align="center"><a class="btn_s" href="javascript:;">确&nbsp;定</a></td>
                    </tr>
                    </tbody></table>
            </div><!--/#uploadFileSuccess-->

            <!-- 没有简历请上传 -->
            <div class="popup" id="deliverResumesNo">
                <table width="100%">
                    <tbody><tr>
                        <td align="center"><p class="font_16">你在拉勾还没有简历，请先上传一份</p></td>
                    </tr>
                    <tr>
                        <td align="center">
                            <form>
                                <a class="btn_addPic" href="javascript:void(0);">
                                    <span>选择上传文件</span>
                                    <input type="file" onchange="file_check(this,'h/nearBy/updateMyResume.json','resumeUpload1')" class="filePrew" id="resumeUpload1" name="newResume" size="3" title="支持word、pdf、ppt、txt、wps格式文件，大小不超过10M">
                                </a>
                            </form>
                        </td>
                    </tr>
                    <tr>
                        <td align="center">支持word、pdf、ppt、txt、wps格式文件，大小不超过10M</td>
                    </tr>
                    </tbody></table>
            </div><!--/#deliverResumesNo-->

            <!-- 上传附件简历操作说明-重新上传 -->
            <div class="popup" id="fileResumeUpload">
                <table width="100%">
                    <tbody><tr>
                        <td>
                            <div class="f18 mb10">请上传标准格式的word简历</div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="f16">
                                操作说明：<br>
                                打开需要上传的文件 - 点击文件另存为 - 选择.docx - 保存
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <a title="上传附件简历" href="#uploadFile" class="inline btn cboxElement">重新上传</a>
                        </td>
                    </tr>
                    </tbody></table>
            </div><!--/#fileResumeUpload-->

            <!-- 上传附件简历操作说明-重新上传 -->
            <div class="popup" id="fileResumeUploadSize">
                <table width="100%">
                    <tbody><tr>
                        <td>
                            <div class="f18 mb10">上传文件大小超出限制</div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="f16">
                                提示：<br>
                                单个附件不能超过10M，请重新选择附件简历！
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <a title="上传附件简历" href="#uploadFile" class="inline btn cboxElement">重新上传</a>
                        </td>
                    </tr>
                    </tbody></table>
            </div><!--/#deliverResumeConfirm-->

        </div>
        <!------------------------------------- end ----------------------------------------->

        <script src="style/js/Chart.min.js" type="text/javascript"></script>
        <script src="style/js/profile.min.js" type="text/javascript"></script>
        <!-- <div id="profileOverlay"></div> -->
        <div class="" id="qr_cloud_resume" style="display: none;">
            <div class="cloud">
                <img width="134" height="134" src="">
                <a class="close" href="javascript:;"></a>
            </div>
        </div>


        <script>
            $(function(){
                $.ajax({
                    url:ctx+"/mycenter/showQRCode",
                    type:"GET",
                    async:false
                }).done(function(data){
                    if(data.success){
                        $('#qr_cloud_resume img').attr("src",data.content);
                    }
                });
                var sessionId = "resumeQR"+314873;
                if(!$.cookie(sessionId)){
                    $.cookie(sessionId, 0, {expires: 1});
                }

//                if($.cookie(sessionId) &amp;&amp; $.cookie(sessionId) != 5){
//                    $('#qr_cloud_resume').removeClass('dn');
//                }

                $('#qr_cloud_resume .close').click(function(){
                    $('#qr_cloud_resume').fadeOut(200);
                    resumeQR = parseInt($.cookie(sessionId)) + 1;
                    $.cookie(sessionId, resumeQR, {expires: 1});
                });
            });
        </script>

        <div class="clear"></div>
        <input type="hidden" value="97fd449bcb294153a671f8fe6f4ba655" id="resubmitToken">
        <a rel="nofollow" title="回到顶部" id="backtop" style="display: none;"></a>
    </div><!-- end #container -->
